package com.example.demo.vo;

import com.diboot.core.binding.annotation.*;
import com.example.demo.entity.ProcurementOrder;
import com.example.demo.entity.ProcurementPlan;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import com.example.demo.entity.Supplier;
import com.example.demo.entity.Express;

/**
 * 采购单 DetailVO定义
 * @author MyName
 * @version 1.0
 * @date 2024-01-18
 * Copyright © MyCompany
 */
@Getter
@Setter
@Accessors(chain = true)
public class ProcurementOrderDetailVO extends ProcurementOrder {

    private static final long serialVersionUID = -3054732538319128790L;

    /**
     * 关联字段 采购计划.名称：ProcurementPlan.name
     */
    @BindField(entity = ProcurementPlan.class, field = "name", condition = "this.procurement_plan_id=id")
    private String procurementPlanName;

    /**
     * 关联字典：PROCUREMENTSTATUS
     */
    @BindDict(type = DICT_PROCUREMENTSTATUS, field = "status")
    private String statusLabel;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.iam_user_id=id")
    private String iamUserRealname;

    /**
     * 关联对象 系统用户：IamUser
     */
    @BindEntity(entity = IamUser.class, condition = "this.iam_user_id=id")
    private IamUser iamUser;

    /**
     * 关联字段 供应商.名字：Supplier.name
     */
    @BindField(entity = Supplier.class, field = "name", condition = "this.supplier_id=id")
    private String supplierName;

    /**
     * 关联字段 快递.名字：Express.name
     */
    @BindField(entity = Express.class, field = "name", condition = "this.express_id=id")
    private String expressName;
}
